import { useEffect } from "react";
import Vditor from "vditor";
/**
 * 
 * @param {string} markdown: The markdown text to show.
 * @param {string} id: id to distinguish different previewer
 * @returns 
 */
export default function MarkdownPreviewer({ markdown, id }) {
    const customId = id || 'markdown-previewer';
    useEffect(() => {
        Vditor.preview(document.getElementById(customId), markdown)
    }, []);
    return (
        <span id={customId}></span>
    )
};
